<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理系统</title>
</head>
<body>

<!--
    /项目虚拟目录/资源路径
-->
    <c:if test="${empty username}">
        <a href="login.jsp">登录</a><br/>
    </c:if>

    <c:if test="${not empty username}">
        <a href="/stu/addStudent.html">添加学生</a>
        <a href="${pageContext.request.contextPath}/listStudentServlet">查看学生</a>
    </c:if>




<%--<%
    //获取username如果有就不显示,没有就显示登录
    String username = (String) session.getAttribute("username");
%>

<%
    if (username == null) {
%>
<a href="login.jsp">登录</a><br/>
<%
} else %>
<%
    {
%>
<a href="/stu/addStudent.html">添加学生</a>
<a href="${pageContext.request.contextPath}/listStudentServlet">查看学生</a>
<%}%>--%>
</body>
</html>
